package com.buobao.oa.service;

import com.buobao.oa.dao.EmployeeDao;
import com.buobao.oa.entity.Employee;
import com.buobao.oa.utils.MybatisUtils;

public class EmployeeService {
    public Employee selectByEmployeeId(Long employeeId) {
        return (Employee) MybatisUtils.executeQuery(sqlSession -> {
            EmployeeDao employeeDao = sqlSession.getMapper(EmployeeDao.class);
            return employeeDao.selectByEmployeeId(employeeId);
        });
    }

    public Employee selectLeader(Employee employee) {
        return (Employee) MybatisUtils.executeQuery(sqlSession -> {
            EmployeeDao employeeDao = sqlSession.getMapper(EmployeeDao.class);
            Employee employee1 = employeeDao.selectLeader(employee);
            return employee1;
        });
    }
}
